package com.wchat.network.message.file;

import org.simpleframework.xml.Element;
import org.simpleframework.xml.Root;

import com.wchat.network.message.Message;

@Root
public class FileReadyMessage extends Message {

	private static final long serialVersionUID = -8945346679699941330L;

	@Override
	public byte getType() {
		return TYPE_FILE_READY;
	}
	
	@Element
	private int dataPort;
	
	@Element
	private FileMessage originalMessage;

	public FileMessage getOriginalMessage() {
		return originalMessage;
	}

	public void setOriginalMessage(FileMessage originalMessage) {
		this.originalMessage = originalMessage;
	}

	public int getDataPort() {
		return dataPort;
	}

	public void setDataPort(int dataPort) {
		this.dataPort = dataPort;
	}
	
	@Override
	public void setDeviceId(long deviceId) {
		if (originalMessage != null)
			originalMessage.setDeviceId(deviceId);
		super.setDeviceId(deviceId);
	}

}
